package com.fulin.thread.semaphore;

public class Task implements Runnable{
	
	private Service service;
	
	public Task(Service service){
		this.service = service;
	}

	@Override
	public void run() {
		for(int i = 0 ;i<100;i++){
			service.testMethod();
		}
	}

	public static void main(String[] args) {
		Service service = new Service();
		for(int i = 0;i< 50;i++){
			Thread t = new Thread(new Task(service),i + "#  ");
			t.start();
		}
	}
}
